<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
		<title>欢迎使用恒旗录单管理系统</title>
		<link rel="stylesheet" href="resource/css/layui.css" />
		<link rel="stylesheet" type="text/css" href="css/normalize.css" />
		<link rel="stylesheet" type="text/css" href="css/demo.css" />
		<!--必要样式-->
		<link rel="stylesheet" type="text/css" href="css/component.css" />
		<!--[if IE]>
		<script src="js/html5.js"></script>
		<![endif]-->
	</head>
	<body>
		<div class="container demo-1">
			<div class="content">
				<div id="large-header" class="large-header">
					<canvas id="demo-canvas"></canvas>
					<div class="logo_box">
						<h3>欢迎使用恒旗录单管理系统</h3>
						<form class="layui-form" action="" name="f">
							<div class="input_outer">
								<span class="u_user"></span>
								<input name="usPhone" required lay-verify="phone" class="text" style="color: #FFFFFF !important" type="text" placeholder="请输入手机号码">
							</div>
							<div class="input_outer">
								<span class="us_uer"></span>
								<input name="usPassword" class="text" style="color: #FFFFFF !important; position:absolute; z-index:100;"value="" type="password" placeholder="请输入密码">
							</div>
							<div class="mb2"><a class="act-but submit" lay-submit lay-filter="formSubmit" href="javascript:;" style="color: #FFFFFF">登录</a></div>
							<div class="mb2"><a class="act-but submit"  href="./a_register" style="color: #FFFFFF">注册</a></div>
						</form>
					</div>
				</div>
			</div>
		</div><!-- /container -->
		<script src="js/TweenLite.min.js"></script>
		<script src="js/EasePack.min.js"></script>
		<script src="js/rAF.js"></script>
		<script src="js/demo-1.js"></script>
		<script src="resource/layui.js"></script>
		
		<script type="text/javascript" th:inline="javascript">
			layui.use(['form','jquery'],function(){
				//判断是否在frame中，在则整体刷新
				if (self != top) { 
					top.location.reload();
				}
				var form = layui.form;
				var $ = layui.$;
				form.on("submit(formSubmit)",function(data){
					$.ajax({
						url : "auser/doALogin",
						data : data.field,
						async : false,
						success : function(res) {
							console.log(res);
							if (res.success) {
								layer.msg('加载中', {
									icon : 16,
									shade : 0.01
								});
							if([[${url}]]){
									window.location = "."+[[${url}]];
								}else{
									window.location = "mobile/index.html";
								}
							} else {
								layer.msg(res.msg);
							} 
						},
						error : function(result) {
	
						}
					});
					return false;
				})
			});
		</script>
	</body>
</html>
